/* UI控件树样式 */

.ui-tree-container {
    height: 100%;
    overflow: auto;
    padding: 10px;
}

.ui-tree {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 14px;
}

.tree-node {
    position: relative;
    padding: 2px 0;
    margin: 2px 0;
}

.tree-toggle, .tree-toggle-placeholder {
    display: inline-block;
    width: 16px;
    height: 16px;
    text-align: center;
    cursor: pointer;
    margin-right: 4px;
    vertical-align: middle;
}

.tree-toggle-placeholder {
    visibility: hidden;
}

.tree-node-content {
    display: inline-block;
    padding: 2px 4px;
    border-radius: 3px;
    cursor: pointer;
    vertical-align: middle;
}

.tree-node-content:hover {
    background-color: rgba(0, 123, 255, 0.1);
}

.tree-node-text {
    margin-left: 4px;
}

.tree-node-id {
    margin-left: 4px;
    color: #6c757d;
    font-size: 0.85em;
}

.tree-children {
    list-style: none;
    padding-left: 20px;
    margin: 0;
}

.tree-children.collapsed {
    display: none;
}

/* 根据节点类型设置不同颜色 */
[data-type="window"] > .tree-node-content {
    color: #007bff;
    font-weight: bold;
}

[data-type="layout"] > .tree-node-content {
    color: #6610f2;
}

[data-type="container"] > .tree-node-content {
    color: #6f42c1;
}

[data-type="view"] > .tree-node-content {
    color: #e83e8c;
}

[data-type="button"] > .tree-node-content {
    color: #dc3545;
}

[data-type="text"] > .tree-node-content {
    color: #28a745;
}

[data-type="input"] > .tree-node-content {
    color: #fd7e14;
}

[data-type="image"] > .tree-node-content {
    color: #20c997;
}

[data-type="checkbox"], [data-type="radio"] > .tree-node-content {
    color: #17a2b8;
}

/* 加载指示器 */
.loading-indicator {
    text-align: center;
    padding: 20px;
    color: #6c757d;
}

.loading-indicator .spin {
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 5px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}